import {Controller,Get,Inject} from '@nestjs/common'
import {LoggerService} from "./logger.service";
import {CommonService} from './common.service'
import {CoreService} from "./core.service";
import {OuterService} from "./outer.service";
import {AppService} from "./app.service";
@Controller('analyse')
export class AppController {
    constructor(
        private LoggerService:LoggerService,
        private CommonService:CommonService,
        private CoreService:CoreService,
        private OuterService:OuterService,
        private AppService:AppService,
        @Inject('PREFIX') private prefix:string
    ){
        this.LoggerService.log("hello");
    }
    @Get('list')
    getList():any{
        this.LoggerService.log("hello list api");

        // 重新导出的provider
        this.CommonService.log('analyse list get method: message ok');
        return ['list01','list02']
    }

    @Get('CoreService')
    CoreServiceMethod(){
        // core模块的provider
        this.CoreService.log();
        return 'CoreService-provider';
    }


    @Get('OuterService')
    OuterServiceMethod(){
        this.OuterService.log('app.controller.OuterServiceMethod');
        return 'app.controller.OuterServiceMethod';
    }

    @Get('dynamicModule')
    DynamicModule(){
        console.log(this.prefix)
        return this.AppService.getConfig();
    }
}
